package com.icangya.DAO.impl;

import com.icangya.DAO.IEditionInfoDAO;
import com.icangya.domain.EditionInfo;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class EditionInfoDAOImpl  extends BaseDAO<EditionInfo> implements IEditionInfoDAO{

    @Override
    public EditionInfo getEditionInfo() {
        String hql="FROM EditionInfo ed order by ed.createTime desc";
      List<EditionInfo> list= (List<EditionInfo>) getHibernateTemplate().find(hql);
      if(list.size()>0)
          return list.get(0);
        return null;
    }

    @Override
    public List getVersion() {
        String hql="FROM EditionInfo ed order by ed.createTime desc";
        List<EditionInfo> list= (List<EditionInfo>) getHibernateTemplate().find(hql);
        if(list.size()>0)
            return list;
        return null;
    }

}
